package chat.ui;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.*;


public class LoginChatWindow extends JFrame {
	
	private int FIELD_WIDTH=100;
	private int FIELD_HEIGHT=20;
	private int LABEL_WIDTH=100;
	private int LABEL_HEIGHT=20;
	private int BUTTON_WIDTH=100;
	private int BUTTON_HEIGHT=30;
	private int POSITION_WIDTH=110;
	
	public LoginChatWindow(){
		
		Toolkit kit = Toolkit.getDefaultToolkit();
		Dimension dm = kit.getScreenSize();
		
		Double screenWidth= dm.getWidth();
		Double screenHeight = dm.getHeight();
		
		Integer w = screenWidth.intValue();
		Integer h = screenHeight.intValue();
		
		setBounds(300,300,w/4,h/4);
		
		setTitle("Login window");
		
		JPanel panel = new JPanel();
		panel.setLayout(null);
		JButton login = new JButton("LOGIN");
		JTextField loginF1 = new JTextField();
		JTextField loginF2 = new JTextField();
		JLabel loginLabel = new JLabel("Username");
		JLabel passLabel = new JLabel("Password");
		loginF1.setBounds(POSITION_WIDTH, 30, FIELD_WIDTH, FIELD_HEIGHT);
		loginF2.setBounds(POSITION_WIDTH, 70, FIELD_WIDTH, FIELD_HEIGHT);
		login.setBounds(POSITION_WIDTH, 100, BUTTON_WIDTH, BUTTON_HEIGHT);
		loginLabel.setBounds(POSITION_WIDTH, 10, LABEL_WIDTH, LABEL_HEIGHT);
		passLabel.setBounds(POSITION_WIDTH, 50, LABEL_WIDTH, LABEL_HEIGHT);
		
		panel.add(loginLabel);
		panel.add(passLabel);
		panel.add(loginF1);
		panel.add(loginF2);
		panel.add(login);
		
		add(panel);
		
		setVisible(true);
		
	}
	
}
